Skip to content

HU-02: Reject ASCII control characters in quoted email local parts - #520

Closed
lisdianara wants to merge 4 commits into
python-validators:masterfrom
ericksc:feature/hu02-email
Closed

lisdianara wants to merge 4 commits into
python-validators:masterfrom
ericksc:feature/hu02-email

Conversation

@lisdianara

Copy link
Copy Markdown

HU-02: ASCII Control Character Validation

Description

Improves email validation by rejecting ASCII control characters in quoted local parts.

Changes

  • Replaced the original SOH-specific test with a parametrized test covering 9 ASCII control character cases, including SOH.
  • Updated the regular expression in src/validators/email.py to reject these control characters.
  • Verified that the behavior of the 95 printable ASCII characters evaluated remains unchanged.

TDD Process

  • RED: The 9 parametrized tests failed before modifying the implementation.
  • GREEN: All 9 tests passed after updating the regular expression.
  • REFACTOR: Reviewed the implementation and confirmed that no additional refactoring was necessary.

Validation Results

  • 9 parametrized tests passed.
  • Existing email regression tests passed.
  • Ruff static analysis: All checks passed!.
  • Full test suite: 1122 passed, 4 failed.

The 4 remaining failures were already present before this change and correspond to other pending functionalities.

@lisdianara lisdianara closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants